<?php
// $Id: default.php 207 2012-03-14 09:52:26Z tomqin@gmail.com $

class default_Controller extends FrontController{

    function init(){
        $this->seoTitle('大连外卖订餐美食网');
    }

    function onIndex(){
        $cachename = 'homepage-'.App::getCityId();

        $html = Cache::get($cachename, 24*3600);
        if(!$html){
            $zone = App::loadModule('zone', true);
            $zone->initCity();

            $sql = Db::getSql('res_id, name, picture, zone_id, subzone_id', 't_store', array('city_deliver' => 0), 23, 'rand()');
            $shopList = Db::select($sql)->fetchAll();

            $this->setVar('zoneInfo', $zone);
            $this->setVar('shopList', $shopList);
            $this->render('default-index');

            $html = ob_get_contents();
            ob_end_clean();
            Cache::set($cachename, $html);
        }
        echo $html;
    }

}
?>